home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / newsgroups / misc.19971216-19980424 / 000049_news@newsmaster….columbia.edu _Sun Jan 4 11:09:45 1998.msg < prev    next >
Internet Message Format  |  1998-04-22  |  8KB

  1. Return-Path: <news@newsmaster.cc.columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id LAA25317
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Sun, 4 Jan 1998 11:09:44 -0500 (EST)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id LAA11052
  7.     for kermit.misc@watsun; Sun, 4 Jan 1998 11:09:44 -0500 (EST)
  8. Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
  9. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  10. Newsgroups: comp.protocols.kermit.misc
  11. Subject: Re: Problem with CKERMIT TRANSMIT
  12. Date: 4 Jan 1998 16:09:36 GMT
  13. Organization: Columbia University
  14. Lines: 161
  15. Message-ID: <68oc80$50p$1@apakabar.cc.columbia.edu>
  16. References: <34aef5e4.0@amhnt2.amherst.edu> <34AF0373.4DDE@videotron.ca> <MPG.f192292fb7106f198968e@news.ma.ultranet.com>
  17. NNTP-Posting-Host: watsun.cc.columbia.edu
  18. Xref: news.columbia.edu comp.protocols.kermit.misc:8217
  19.  
  20. In article <MPG.f192292fb7106f198968e@news.ma.ultranet.com>,
  21. John A Santos <jasantos@ultranet.com> wrote:
  22. : In article <34AF0373.4DDE@videotron.ca>,
  23. : jf mezei <"[non-spam]jfmezei"@videotron.ca> says...
  24. : > John W. Manly wrote:
  25. : > > I've been running into a very frustrating problem with the CKERMIT
  26. : > > TRANSMIT command when used over TCP/IP to a port other than the standard
  27. : > > TELNET port (port 23).
  28. : > 
  29. : > > But the TRANSMIT operation never seems to work, though the rest of the
  30. : > > script does work.  
  31. :
  32. TRANSMIT just blasts the contents of the file out the communication
  33. connection, more or less.  There are a few adjustments you can make.  Its
  34. operations and the adjustments you can make to them are described in detail
  35. in "Using C-Kermit", 2nd Edition, Chapter 15.
  36.  
  37. : > Been there, experienced the same thing. I fixed it wth the use of 
  38. : > open read file.name
  39. : > :myloop
  40. : > read \%a
  41. : > if fail goto mydone
  42. : > output \%a\%13
  43. : > goto myloop
  44. : > 
  45. : > :mydone
  46. : > close read
  47. :
  48. This does just about the same thing that TRANSMIT does, but evidently
  49. slows the process down enough, in this case, to allow the application on the
  50. other end to keep up.  You might just as well have used:
  51.  
  52.   set transmit pause xxx
  53.  
  54. where xxx is the number of milliseconds to pause after sending each line.
  55.  
  56. Also, the loop above does not read back echoes from the other end, so if
  57. the other end is indeed echoing, the echoes might fill up the reverse channel
  58. and eventually block it.
  59.  
  60. : > Also, what I find most interesting is that sending \13 seems to result
  61. : > in \13\10 being sent ! 
  62. :
  63. It is being sent.  C-Kermit 6.0 and earlier do this on all TCP connections,
  64. Telnet or not (except Rlogin), by default, since experience shows that most
  65. servers on non-Telnet ports (except Rlogin), even though they might not do
  66. Telnet protocol negotiations, still follow the Telnet NVT specification,
  67. which demands this.  If if causes problems, you can use:
  68.  
  69.   set telnet newline-mode binary
  70.  
  71. to force CR to be sent as CR alone.
  72.  
  73. : > I am on VMS 5.5-2, CKERMIT 6.0.192 6 sep 96   (VAX, of course).
  74. : > TCP stack is CMU-IP.
  75. : > 
  76. : We're using C-Kermit to talk to an SMTP server, using both output
  77. : and TRANSMIT commands.  The key (for OUTPUT) is you need to do
  78. : INPUT's to soak up the echoes and responses from the server.  SMTP
  79. : gives numeric response codes for various commands and errors;
  80. : we look for these in the responses to make sure everything is working.
  81. : The data (i.e. mail message) doesn't produce a response, just an echo.
  82. : I think it is the SMTP server that is echoing \13 as \13\10, not
  83. : Kermit sending \13\10.  Anyway, we were sending each line with a \13
  84. : and then waiting for the \13\10 in the response with an INPUT.
  85. Right.  SMTP is a protocol that has messages containing function codes.
  86. By the way, these can be handled very nicely in C-Kermit 6.0 and MSK 3.15
  87. with the new MINPUT and SWITCH statements (for an example, see the C-Kermit
  88. TAP alpha paging script).
  89.  
  90. : If you use TRANSMIT, it should soak up the echoes for you automatically
  91. : but it won't understand the protocol stuff.
  92. :
  93. Right.
  94.  
  95. : I'm not familiar with NNTP, but SMTP has some specific handshaking that
  96. : you have to do with the server and I think NNTP must be similar.  You need
  97. : to send a HELO hostname command, and wait for the response, to identify
  98. : the sending system.  Then you need to send a FROM: command and a TO:
  99. : command, identifying the sender and receiver's mail addresses, waiting for
  100. : responses in each case.  (I forget the precise order and format of these
  101. : commands...)  Then you need to send a DATA command.  The server replies to
  102. : the data command with a message telling you its okay to start sending, and
  103. : to terminate the message with a line with a single period.  When we get
  104. : this message, we send a text file with the formatted mail message in it,
  105. : using TRANSMIT.  After the transmit, we OUTPUT .\13 and wait for the SMTP
  106. : server to say it got it (with another INPUT.)
  107. : There are a couple of gotcha's with SMTP that might apply to NNTP, too.
  108. : SMTP uses a line consisting solely of a period to indicate end-of-
  109. : message, so you have to stuff an extra period at the beginning of
  110. : any line starting with a period to avoid it seeing a false end-of-
  111. : message.  We do this in formatting the mail message file before
  112. : transmitting it.
  113. : The second gotcha is really a Kermit issue.  OUTPUT has an escape
  114. : mechanism: \number gets converted to an ASCII character whose value
  115. : is the number (e.g. \13 gets converted to <CR>), and \{special-char}
  116. : gets converted as well, where special-char is any of a list of
  117. : things.  For example, \n becomes a <null>, \\ becomes a single back-
  118. : slash, etc.  We need to suppress the translation to allow these literal
  119. : strings to appear in mail messages (\n wreaks havoc with C programs,
  120. : and all the substitutions occur with annoying frequency in MIME-encoded
  121. : documents.)  There is a work-around for this (can I mention it yet,
  122. : Frank?)...
  123. :
  124. In the following script fragment:
  125.  
  126.   read \%a
  127.   if fail ...
  128.   output \%a\13
  129.  
  130. we read a line from a file into the variable \%a.  In the OUTPUT command, we
  131. need to replace the variable by its contents, so we can't (e.g.) turn off
  132. variable expansion entirely with SET COMMAND QUOTING OFF, because then the
  133. OUTPUT command would send "\%a\13" literally.
  134.  
  135. However if we leave it ON, the variable \%a is evaluated recursively, so
  136. if the line contains any backslashes, the parser "interprets" them.  This is
  137. not a bug, but a design feature (see the boilerplate-letter example in the
  138. manual).
  139.  
  140. It would seem the solution is to use the *other* kind of variable, the kind
  141. that is evaluated one level only, not recursively:
  142.  
  143.   read line
  144.   if fail ...
  145.   output \m(line)\13
  146.  
  147. This works fine provided (as John points out), the line does not contain
  148. the special OUTPUT escapes, \N, \B, or \L for sending NUL and BREAK.
  149.  
  150. C-Kermit 6.1 (still in development; watch this space for announcements) has 
  151. a new command:
  152.  
  153.   SET OUTPUT SPECIAL-ESCAPES { ON, OFF }
  154.  
  155. to control this.  If you want to send the lines of a text file literally,
  156. no matter what they contain, in a READ / OUTPUT loop, you can use:
  157.  
  158.   set output special-escapes off
  159.   open read foo.txt
  160.   if fail stop 1 can't open file
  161.   while 1 {
  162.       read line
  163.       if fail break
  164.       output \m(line)\13
  165.   }
  166.  
  167. : ... but TRANSMIT doesn't have this problem, and is quite a bit
  168. : faster than a READ-OUTPUT-INPUT loop, so we use TRANSMIT for the body
  169. : of the message.
  170. I don't know how NNTP works either, offhand, but if it really just wants
  171. bunch of lines, you should be able to use the TRANSMIT command.  Read about
  172. all the options in the manual, especially SET TRANSMIT PROMPT (wait for echo),
  173. SET TRANSMIT FILL (filler for empty lines), and SET TRANSMIT EOF (what to
  174. send upon end of file).
  175.  
  176. - Frank